package com.sz.service.impl;

import com.sz.dao.UsersDao;
import com.sz.entity.Users;
import com.sz.service.UsersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.security.PublicKey;

@Service
public class UsersServiceImpl implements UsersService {

    @Resource
    private UsersDao usersDao;

    /**
     * 用户登录
     * @param users
     * @return
     */
    @Override
    public Users getUsersByNamePwd(Users users) {
        return usersDao.getUsersByNamePwd(users);
    }

    /**
     * 根据用户名查询用户密码(密文)
     * @param username
     * @return
     */
    @Override
    public String getUserpwd(String username) {
        return usersDao.getUserpwd(username);
    }

    /**
     * 用户手机号码验证登录
     * @param users
     * @return
     */
    @Override
    public Users getUsersByPhone(Users users) {
        return usersDao.getUsersByPhone(users);
    }

    /**
     * 用户注册
     * @param users
     * @return
     */
    @Override
    public int getAddUsers(Users users) {
        return usersDao.getAddUsers(users);
    }

    /**
     * 验证用户名是否唯一
     * @param username
     * @return
     */
    @Override
    public int getCheckUserName(String username) {
        return usersDao.getCheckUserName(username);
    }

    /**
     * 验证手机号码是否已被注册
     * @param phone
     * @return
     */
    @Override
    public int getCheckUserPhone(String phone) {
        return usersDao.getCheckUserPhone(phone);
    }


}
